package com.henu.ocr.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.henu.ocr.entity.Company;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.scheduling.annotation.Async;

import java.util.List;
import java.util.concurrent.Future;

@SuppressWarnings("all")
public interface CompanyService extends IService<Company> {
    List<Company> findAllCompany();
    Company findCompanyById(Integer id);
    List<Company> findSubCompanyById(Integer id);

    @Async
    Future<Boolean> completeCompanyDetailsAsync(Company company, String fathercorp);


    @Cacheable(value = "company", key = "'company'+#mdmCode")
    Company findCompanyByMdmCode(String mdmCode);

    @CacheEvict(value = "company", key = "'company'+#company.mdmPkCorp")
    boolean updateCompanyWithIndexs(Company company);
}
